﻿#ifndef CAMERAMANAGER_H
#define CAMERAMANAGER_H

#include <QSharedPointer>
#include "cameraProvider.h"
#include "hkCameraItem.h"
#include "jfCameraItem.h"

class CameraManager : public QObject
{
    Q_OBJECT
private:
    CameraManager();

public:

    static CameraManager& I();



    bool initCamera();

    Q_INVOKABLE bool addCamera(QString cameraName, QString ip, int port, QString usrname, QString pswd, QString cameraType);
    Q_INVOKABLE bool deleteCamera(QString cameraName);

    Q_INVOKABLE bool connectCamera(QString cameraName);


    Q_INVOKABLE bool startCaptureCamera(QString cameraName);
    Q_INVOKABLE bool stopCaptureCamera(QString cameraName);




signals:
    void sigRefreshCameraImage(QString cameraName);


private slots:
    void onCameraRefresh(QString cameraName);

private:

    // cameraList和provider分开放吧……
    QMap<QString, QSharedPointer<CameraItem>>   _cameraList;

    QSharedPointer<CameraImageProvider>    _provider1;
    QSharedPointer<CameraImageProvider>    _provider2;
    QSharedPointer<CameraImageProvider>    _provider4;



};

#endif // CAMERAMANAGER_H
